package com.demo.function.spring.feign.config;

import com.demo.function.spring.feign.log.FeignLogger;
import feign.Logger;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Feign日志配置
 * 在Feign请求之前和之后都会打印日志
 */
@Configuration
public class FeignLoggerConfig {

    /**
     * Feign日志记录器。在启动日志记录器之前，需要先配置feign.Logger.Level。具体配置在application.yaml中。
     * @return FeignLogger
     */
    @Bean
    public Logger feignLogger() {
        return new FeignLogger();
    }
}
